<template>
  <a-form :form="form">
    <a-row>
     <a-col :md="12" :sm="24">
        <a-form-item
          label="学号"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-input disabled v-decorator="['xh']"/>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="入学年月"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-date-picker v-decorator="['rxny']" style="width: 100%"  format="YYYY-MM-DD"/>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="学生类别"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-select :allowClear="true" v-decorator="['xslbm']"  @change="(value, option) => {setData(option, 'xslbmc')}">
            <a-select-option v-for="i in TYPE0075" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
          </a-select>
          <!-- <a-input v-decorator="['xslbmc']" type="hidden"/> -->
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="学制"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-select :allowClear="true" v-decorator="['xz']"  @change="(value, option) => {setData(option, 'xslbmc')}">
            <a-select-option v-for="i in TYPE0301" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
          </a-select>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="所在年级"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-select :allowClear="true" v-decorator="['sznj']">
            <a-select-option v-for="i in TYPE0126" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
          </a-select>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="所属院系"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-select :allowClear="true" v-decorator="['ssyxm']" showSearch :filterOption="filterOption" @change="yxChange">
            <a-select-option v-for="i in selectMenu.yxList" :key="i.id" :value="i.dwh">{{ i.dwh }} {{ i.dwmc }}</a-select-option>
          </a-select>
          <!-- <a-input v-decorator="['ssyxmc']" type="hidden"/> -->
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="所属专业"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-select :allowClear="true" showSearch :filterOption="filterOption" v-decorator="['sszym']">
            <a-select-option v-for="i in selectMenu.zyList" :key="i.id" :value="i.zyh">{{ i.zyh}} {{ i.zymc }}</a-select-option>
          </a-select>
          <!-- <a-select :allowClear="true" v-decorator="['sszym']" @change="(value, option) => {setData(option, 'sszymc')}">
            <a-select-option v-for="i in TYPE0075" :key="i.id" :value="String(i.code)">{{ i.name }}</a-select-option>
          </a-select> -->
          <!-- <a-input v-decorator="['sszymc']" type="hidden"/> -->
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="所在班号"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-input v-decorator="['szbh']"/>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="学生当前状态"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-select :allowClear="true" v-decorator="['xsdqztm']">
            <a-select-option v-for="i in TYPE0073" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
          </a-select>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="培养模式"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-select :allowClear="true" v-decorator="['pymsm']">
            <a-select-option v-for="i in TYPE0347" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
          </a-select>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="培养方式"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-select :allowClear="true" v-decorator="['pyfsm']">
            <a-select-option v-for="i in TYPE0059" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
          </a-select>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="财务编号"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-input v-decorator="['cwbh']"/>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="录取类别"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-select :allowClear="true" v-decorator="['lqlbm']">
            <a-select-option v-for="i in TYPE0362" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
          </a-select>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="导师职工号"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-input v-decorator="['dszgh']"/>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="导师姓名"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-input v-decorator="['dsxm']"/>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="第二导师职工号"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-input v-decorator="['dedszgh']"/>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="第二导师姓名"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-input v-decorator="['dedsxm']"/>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="培养分类"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-select :allowClear="true" v-decorator="['pyflm']">
            <a-select-option v-for="i in TYPE0120" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
          </a-select>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="导师职称"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-select :allowClear="true" v-decorator="['dszcm']">
            <a-select-option v-for="i in TYPE0342" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
          </a-select>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="第二导师职称"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-select :allowClear="true" v-decorator="['dedszcm']">
            <a-select-option v-for="i in TYPE0342" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
          </a-select>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="分院"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-input v-decorator="['fy']"/>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="入学方式"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-select :allowClear="true" v-decorator="['rxfs']">
            <a-select-option v-for="i in TYPE0064" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
          </a-select>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="来源国"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-select :allowClear="true" showSearch :filterOption="filterOption" v-decorator="['lygbm']">
            <a-select-option v-for="i in TYPE0015" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
          </a-select>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item style="width:100%" label="来源地区" :labelCol="{span: 7,offset: 1}" :wrapperCol="{span: 16}">
            <a-select style="width:33%" @change="provinceChange" v-decorator="['lydqms']" :allowClear="true">
              <a-select-option v-for="i in selectMenu.province" :key="i.areaCode" :value="String(i.areaCode)">{{ i.name }}</a-select-option>
            </a-select>
            <a-select style="width:33%" @change="cityChange" v-decorator="['lydqmc']" :allowClear="true">
              <a-select-option v-for="i in selectMenu.city" :key="i.areaCode" :value="String(i.areaCode)">{{ i.name }}</a-select-option>
            </a-select>
            <a-select style="width:33%" v-decorator="['lydqmxq']" :allowClear="true">
              <a-select-option v-for="i in selectMenu.area" :key="i.areaCode" :value="String(i.areaCode)">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="培养层次"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-select :allowClear="true" v-decorator="['pyccm']">
            <a-select-option v-for="i in TYPE0310" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
          </a-select>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="招生季节"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-select :allowClear="true" v-decorator="['zsjjm']">
            <a-select-option v-for="i in TYPE0309" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
          </a-select>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="研究方向"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-select :allowClear="true" v-decorator="['yjfxm']">
            <a-select-option v-for="i in selectMenu.yjfx" :key="i.id" :value="i.yjfxm">{{ i.yjfxmc }}</a-select-option>
          </a-select>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="学习形式"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-select :allowClear="true" v-decorator="['xxxsm']">
            <a-select-option v-for="i in TYPE0307" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
          </a-select>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="借书证号"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-input v-decorator="['jszh']"/>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="考生编号"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-input v-decorator="['ksbh']"/>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="考生报名号"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-input v-decorator="['ksbmh']"/>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="定向或委培单位"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-input v-decorator="['dxhwpdw']"/>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="参加工作时间"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-date-picker v-decorator="['gzsj']" style="width: 100%" format="YYYY-MM-DD"/>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="工作单位"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-input v-decorator="['gzdw']"/>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="职务"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-input v-decorator="['zw']"/>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="职称"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-input v-decorator="['zc']"/>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="培养单位名称"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-input v-decorator="['pydwmc']"/>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="办学形式"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-select :allowClear="true" v-decorator="['bxxsm']">
            <a-select-option v-for="i in TYPE0333" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
          </a-select>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="办学类型"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-select :allowClear="true" v-decorator="['bxlxm']">
            <a-select-option v-for="i in TYPE0030" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
          </a-select>
          <!-- <a-input v-decorator="['bxxs']" type="hidden"/> -->
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="学校所在地名称"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-input v-decorator="['xxszdmc']"/>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="毕业年月"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-date-picker v-decorator="['dxbyny']" style="width: 100%" format="YYYY-MM-DD"/>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="学科"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-select :allowClear="true" showSearch :filterOption="filterOption" v-decorator="['xkm']">
            <a-select-option v-for="i in selectMenu.xk" :key="i.id" :value="i.xkdm">{{ i.xkmc }}</a-select-option>
          </a-select>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="学业奖学金等级"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-select :allowClear="true" v-decorator="['xyjxjdjm']">
            <a-select-option v-for="i in TYPE0311" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
          </a-select>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="助研奖学金等级"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-select :allowClear="true" v-decorator="['zyjxjdjm']">
            <a-select-option v-for="i in TYPE0312" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
          </a-select>
        </a-form-item>
      </a-col>
      <a-col :md="12" :sm="24">
        <a-form-item
          label="学历"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-select :allowClear="true" v-decorator="['xlm']">
            <a-select-option v-for="i in TYPE0018" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
          </a-select>
        </a-form-item>
      </a-col>
    </a-row>
    <!-- <a-row style="margin-top:20px">
      <a-col :md="8" :sm="24">
        <a-form-item
          label="创建人"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-input v-decorator="['createBy']"/>
        </a-form-item>
      </a-col>
      <a-col :md="8" :sm="24">
        <a-form-item
          label="更新人"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-input v-decorator="['updateBy']"/>
        </a-form-item>
      </a-col>
    </a-row>
    <a-row>
      <a-col :md="8" :sm="24">
        <a-form-item
          label="创建时间"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-date-picker v-decorator="['createDate']" style="width: 100%" format="YYYY-MM-DD"/>
        </a-form-item>
      </a-col>
      <a-col :md="8" :sm="24">
        <a-form-item
          label="更新时间"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-date-picker v-decorator="['updateDate']" style="width: 100%" format="YYYY-MM-DD"/>
        </a-form-item>
      </a-col>
      <a-col :md="8" :sm="24">
        <a-form-item
          label="备注"
          :labelCol="{span: 7,offset: 1}"
          :wrapperCol="{span: 15, offset: 1}"
        >
          <a-input v-decorator="['note']"/>
        </a-form-item>
      </a-col>
    </a-row> -->
  </a-form>
</template>
<script>
import { mapState } from 'vuex'
const selectArr = ['TYPE0018', 'TYPE0301', 'TYPE0120', 'TYPE0312', 'TYPE0311', 'TYPE0333', 'TYPE0307', 'TYPE0310', 'TYPE0015', 'TYPE0064', 'TYPE0342', 'TYPE0020', 'TYPE0362', 'TYPE0059', 'TYPE0347', 'TYPE0073', 'TYPE0075', 'TYPE0126', 'TYPE0030', 'TYPE0309']
export default {
  props: {
    info: {
      type: Object
    }
  },
  data () {
    return {
      selectMenu: {}
    }
  },
  computed: {
    ...mapState({
      TYPE0126: state => state.app['TYPE0126'], // 年级
      TYPE0075: state => state.app['TYPE0075'], // 学生类别
      TYPE0073: state => state.app['TYPE0073'], // 学生当前状态
      TYPE0347: state => state.app['TYPE0347'], // 培养模式
      TYPE0059: state => state.app['TYPE0059'], // 培养方式
      TYPE0362: state => state.app['TYPE0362'], // 录取类别
      TYPE0020: state => state.app['TYPE0020'], // 政治面貌
      TYPE0342: state => state.app['TYPE0342'], // 导师职称
      TYPE0064: state => state.app['TYPE0064'], // 入学方式
      TYPE0015: state => state.app['TYPE0015'], // 来源国
      TYPE0310: state => state.app['TYPE0310'], // 培养层次
      TYPE0307: state => state.app['TYPE0307'], // 学习形式
      TYPE0030: state => state.app['TYPE0030'], // 办学类型
      TYPE0333: state => state.app['TYPE0333'], // 办学形式
      TYPE0311: state => state.app['TYPE0311'], // 学业奖学金等级
      TYPE0312: state => state.app['TYPE0312'], // 助研奖学金等级
      TYPE0018: state => state.app['TYPE0018'], // 学历
      TYPE0309: state => state.app['TYPE0309'], // 招生季节
      TYPE0120: state => state.app['TYPE0120'], // 招生季节
      TYPE0301: state => state.app['TYPE0301'], // 招生季节
    })
  },
  beforeCreate () {
    this.form = this.$form.createForm(this)
  },
  created () {
    selectArr.forEach(v => {
      this.$store.dispatch('app/setDictionary', v)
    })
    this.initSelectMenu()
    this.$nextTick(() => {
      if (this.info.xjxx.ssyxm) {
        this.$api.base.majorAll({lsdwh: this.info.xjxx.ssyxm}).then(res => {
          this.$set(this.selectMenu, 'zyList', res.data)
        })
      }
      if (this.info.xjxx.pymsm) {
        this.$api.base.subjectAll({pymsm: this.info.xjxx.pymsm}).then(res => {
          this.$set(this.selectMenu, 'xk', res.data)
        })
      }
      if (this.info.xjxx.lydqms) {
        this.provinceChange(this.info.xjxx.lydqms)
      }
      if (this.info.xjxx.lydqmc) {
        this.cityChange(this.info.xjxx.lydqmc)
      }
      let keys = Object.keys(this.form.getFieldsValue())
      let obj = {}
      keys.forEach(key => {
        obj[key] = this.info.xjxx[key]
      })
      this.form.setFieldsValue(obj)
    })
  },
  methods: {
    initSelectMenu () {
      let allRequest = [
        this.$api.base.areaList(),
        this.$api.base.collegeAll(),
        this.$api.base.researchListByStu({xh: this.info.xjxx.xh})
        // this.$api.base.subjectAll()
      ]
      Promise.all(allRequest).then(res => {
        this.selectMenu = {
          province: res[0].data,
          yxList: res[1].data,
          yjfx: res[2].data
          // subjects: res[3].data
        }
      })
    },
    setData (option, key) {
      this.form.setFieldsValue({[key]: option.data.attrs.name})
    },
    provinceChange (v) {
      this.form.setFieldsValue({lydqmc: '', lydqmxq: ''})
      if (v) {
        this.$api.base.areaList({parentCode: v}).then(res => {
          this.$set(this.selectMenu, 'city', res.data)
        })
      } else {
        this.$set(this.selectMenu, 'city', [])
      }
      this.$set(this.selectMenu, 'area', [])
    },
    cityChange (v) {
      this.form.setFieldsValue({lydqmxq: ''})
      if (v) {
        this.$api.base.areaList({parentCode: v}).then(res => {
          this.$set(this.selectMenu, 'area', res.data)
        })
      } else {
        this.$set(this.selectMenu, 'area', [])
      }
    },
    filterOption (value, op) {
      return op.componentOptions.children[0].text.indexOf(value) !== -1
    },
    yxChange (code) {
      this.form.setFieldsValue({sszym: ''})
      if (code) {
        this.$api.base.majorAll({lsdwh: code}).then(res => {
          this.$set(this.selectMenu, 'zyList', res.data)
        })
      } else {
        this.$set(this.selectMenu, 'zyList', [])
      }
    },
    save () {
      this.form.validateFields((err, values) => {
        if (err) {
          return
        }
        this.$DateToString(values)
        this.$DateToString(values.xjxx)
        let params = Object.assign(this.info, {xjxx: values})
        this.$api.student.studentUpdate({xsxx: params}).then(res => {
          this.$message('操作成功')
        })
      })
    }
  }
}
</script>
